package com.ck.chuangke.service;

import com.ck.exception.ServiceException;
import com.ck.model.chuangke.dto.CkDeviceModelDTO;
import com.ck.model.common.DeviceModel;
import com.ck.model.common.vo.DeviceModelListVO;
import com.github.pagehelper.Page;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**
 * @ClassName CkDeviceModelService
 * @Description 创客管理后台-机型管理service
 * @Author HanQinrui
 * @Date 2018/7/6 14:47
 * @Version 1.0
 **/
public interface CkDeviceModelService {
    /**
     * 获取终端型号分页列表
     * @param pageNum
     * @param pageSize
     * @return
     */
    Page<DeviceModelListVO> listDeviceModelByPage(Integer pageNum, Integer pageSize);

    /**
     * 通过型号名称查找终端机型信息
     * @param modelName 型号名称
     * @return
     */
    DeviceModel getDeviceModelByName(String modelName);

    /**
     * 新增终端机型
     * @param deviceModel
     * @param request
     */
    void addDeviceModel(DeviceModel deviceModel, HttpServletRequest request);

    /**
     * 批量删除终端型号
	 * @param deviceModelIds 终端型号Id(多个Id之间用逗号隔开 )
	 * @param request
	 */
    void deleteDeviceModelBatch(String deviceModelIds, HttpServletRequest request);

    /**
	 * 获取终端型号列表
	 *
	 * @return List<CkDeviceModelDTO>
	 */
	List<CkDeviceModelDTO> listDeviceModels();

	/**
	 * 查询升级包中的适用机型
	 * @param deviceUpgradeId 升级ID
	 * @return List<DeviceModelDTO>
	 */
	List<CkDeviceModelDTO> listDeviceModelsSelectedUpgrade(Long deviceUpgradeId);

	/**
	 * 根据主键查询机型
	 * @param deviceModelId 机型
	 * @return DeviceModel
	 */
    DeviceModel getDeviceModelById(Long deviceModelId);

	/**
	 * 修改机型
	 * @param deviceModel 机型数据
	 * @param request     请求
	 */
	void updateByPrimaryKeySelective(DeviceModel deviceModel, HttpServletRequest request) throws ServiceException;
}
